<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class PrintController extends Controller
{
    public function print(Request $request)
    {
    	$this->cell_print('', $content);
    }

    public function cell_print($machine,$content)
    {
        $url="http://dev-ktvprint.ffun360.com/yilianyun?machine_id=".$machine."&contents=".urlencode($content);

        $this->httpGet($url);
    }
    
    public function httpGet($url)
    {
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 500);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($curl, CURLOPT_URL, $url);
        $res = curl_exec($curl);
        curl_close($curl);
        return $res;
    }
}
